package net.htjs.mobile.nyoa;

import net.htjs.mobile.nyoa.gw.ListGwWebView;
import net.htjs.mobile.nyoa.util.L;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;

public class TabMainActivity  extends TabActivity{
	
	private TabHost tabHost;
	private static final String HOME = "新闻列表";
	private static final String REFER = "功能模块";
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE); 
		setContentView(R.layout.tabhost);
		
		tabHost = this.getTabHost();

		View view1 = View.inflate(TabMainActivity.this, R.layout.tab, null);
		((ImageView) view1.findViewById(R.id.tab_imageview_icon)).setImageResource(R.drawable.tab_timeline_selector);
		((TextView) view1.findViewById(R.id.tab_textview_title)).setText(HOME);

		Intent intent = new Intent();
		Bundle bundle = new Bundle();
		bundle.putString(L.ZT, "ZB");
		bundle.putString(L.LX,"XW");
		//bundle.putString(L.LX, L.Nine.GW);
		intent.setClass(TabMainActivity.this, ListGwWebView.class);
		intent.putExtras(bundle);
		
		TabHost.TabSpec spec1 = tabHost.newTabSpec(HOME)
				.setIndicator(view1)
				.setContent(intent);
		tabHost.addTab(spec1);
		
		View view2 = View.inflate(TabMainActivity.this, R.layout.tab, null);
		((ImageView) view2.findViewById(R.id.tab_imageview_icon)).setImageResource(R.drawable.tab_atme_selector);
		((TextView) view2.findViewById(R.id.tab_textview_title)).setText(REFER);

		TabHost.TabSpec spec2 = tabHost.newTabSpec(REFER)
				.setIndicator(view2)
				.setContent(new Intent(this, nineActivity.class));
		tabHost.addTab(spec2);
		/*
		TabHost tabHost = getTabHost();
		LayoutInflater.from(this).inflate(R.layout.gwview,tabHost.getTabContentView(), true);
		tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("新闻列表").setContent(new Intent(this, GwList.class)));
		tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("功能模块").setContent(R.id.tab2));
		//tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("办理轨迹").setContent(R.id.tab3));
	*/}
}
